﻿@using Ext.Net
@using Ext.Net.MVC
@model DoAnForum.Models.RegisterModel
@{
    ViewBag.Title = "Register";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@Html.X().ResourceManager().Theme(Theme.Default)
@Html.X().FormPanel().ID("FormPanelRegister").Border(false).StyleSpec("position: static; z-index: 10;width: 100%;").Listeners(
    ls => ls.ValidityChange.Handler = "App.btnSave.setDisabled(!valid)").Items(
        Html.X().Label().Text("Tạo tài khoản mới").StyleSpec("color:green; font-weight:bold; font-size:18").Margin(30),
        Html.X().TextFieldFor(m => m.UserName).FieldLabel("UserName").LabelWidth(130).Width(500).StyleSpec("margin: 30px;"),
        Html.X().TextFieldFor(m => m.Email).FieldLabel("Email").LabelWidth(130).Width(500).StyleSpec("margin: 30px;"),
        Html.X().TextFieldFor(m => m.Password).InputType(Ext.Net.InputType.Password).FieldLabel("Password").LabelWidth(130).Width(500).StyleSpec("margin: 30px;"),
        Html.X().TextFieldFor(m => m.ConfirmPassword).InputType(Ext.Net.InputType.Password).FieldLabel("ConfirmPassword").LabelWidth(130).Width(500).StyleSpec("margin: 30px;"),
        Html.X().DateFieldFor(m=>m.BirthDay).FieldLabel("Ngày sinh").LabelWidth(130).Width(250).StyleSpec("margin: 30px;"),
        Html.X().FileUploadField().FieldLabel("Ảnh đại diện").ID("UpImage").Icon(Icon.ImageAdd).Width(580).LabelWidth(130).StyleSpec("margin: 30px;").Flex(1),
        Html.X().HtmlEditorFor(m=>m.UserSignature).FieldLabel("Chữ ký").LabelWidth(130).Width(600).StyleSpec("margin: 30px;"),
        Html.X().Panel().Width(100).StyleSpec("Float: right").Margin(10).Border(false).Items(
            Html.X().Button().ID("btnSave").Text("Đồng ý").Width(80).Margin(10).Disabled(true).DirectEvents(de=>
                                                                                                                {
                                                                                                                    de.Click.Url = Url.Action("Register");
                                                                                                                    de.Click.EventMask.ShowMask = true;
                                                                                                                    de.Click.FormID = "FormPanelRegister";
                                                                                                                })
            )
                                                                                                  )
